package com.company;

import service_interface.MyServiceInterface;

public class Main {

    public static void main(String[] args) {
        int counter=0;
        //遍历所有的Service对象
        for(MyServiceInterface service:MyServiceInterface.getServices()){
            counter++;
            System.out.print("("+counter+")"+service.getName()+":");
            service.doSomething();
        }
        System.out.println("\n总共实例化对象个数："+counter);
    }
}
